module.exports = function pathToReg(path, keys) {
    return path.replace(/:([^\/]+)/g, function (_, $1) {
        keys.push({
            name: $1
        })
        return "([^\/]+?)";
    })
}